<?php
/**
 * Constants for autoload
 *
 * <p>Defines the default php file extension type, and the default
 * directory separator.
 * 
 * TODO should there be a constant for the underscore?
 */
define("EXTENSION", ".php");

/**
 * Load files by decoding their class names
 *
 * @param String $classname classname which follows the PEAR convention
 */
function __autoload($classname) {
	$root = basename(__FILE__, EXTENSION);
	$path = str_replace("_", DIRECTORY_SEPARATOR, $classname);
	require($path . EXTENSION);
}
?>